package com.example.myspringboot.caffeine.testDemo;

import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.example.myspringboot.demos.web.User;
import com.example.myspringboot.domain.ImChatUserGroupMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author zheng
 */
@Controller
public class CaffeineController {

    @Autowired
    private CaffeineService caffeineService;

    @RequestMapping("/cache-izuul/query2")
    @ResponseBody
    public List<ImChatUserGroupMessage> queryFullReductionProductstoreRela(String id) {
        String[] ids = id.split(",");
        List<ImChatUserGroupMessage> list = caffeineService.getFullReductionList(ids);
        if (CollectionUtils.isNotEmpty(list)) {
            return list;
        } else {
            return null;
        }
    }
}
